Setting keys will be stored on const strings#3750
Merged
Martí Climent (marticliment) merged 12 commits intoJun 16, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the way settings keys are accessed throughout the codebase by replacing string literals with enum-based constant keys for improved consistency and ease of use. Key changes include:
- Replacing literal string keys with enums (Settings.K and SecureSettings.K) in various managers and helper classes.
- Updating test cases to use the new keys.
- Refining dictionary handling and logging in SettingsEngine components.
Reviewed Changes
Copilot reviewed 62 out of 62 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/UniGetUI.PackageEngine.Managers.PowerShell7/PowerShell7.cs | Updated redundant namespace reference for UTF8 encoding. |
| src/UniGetUI.PackageEngine.Managers.Pip/Pip.cs | Replaced string literal settings keys with enum keys. |
| src/UniGetUI.PackageEngine.Managers.Pip/Helpers/PipPkgDetailsHelper.cs | Updated log type reference to use enum instead of qualified string. |
| src/UniGetUI.PackageEngine.Managers.Generic.NuGet/BaseNuGet.cs | Refactored Settings.Get calls to use key enums. |
| src/UniGetUI.PackageEngine.Managers.Chocolatey/Chocolatey.cs | Updated various settings key usage and commented out obsolete code remains intact. |
| src/UniGetUI.Interface.Telemetry/TelemetryHandler.cs | Refactored settings key usage and updated telemetry bitmask generation. |
| src/UniGetUI.Interface.BackgroundApi/BackgroundApi.cs | Updated Settings.SetValue call to use enum key. |
| src/UniGetUI.Core.Tools/Tools.cs | Refactored proxy settings key usage. |
| src/UniGetUI.Core.Tools/DWMThreadHelper.cs | Refactored settings key checks for thread optimizations. |
| src/UniGetUI.Core.Tools.Tests/MetaTests.cs | Updated error messages to reflect key enum usage. |
| src/UniGetUI.Core.Settings/* | Refactored settings engine (Names, Extras, Dictionaries, Engine, Tests) to consistently use enum keys. |
| src/UniGetUI.Core.SecureSettings/SecureSettings.cs | Migrated secure settings to enum-based keys. |
| src/UniGetUI.Core.LanguageEngine/* | Updated language engine to use enum keys for PreferredLanguage and related settings. |
| src/UniGetUI.Core.IconStore/IconDatabase.cs | Updated IconDataBaseURL retrieval to use enum keys. |
Comments suppressed due to low confidence (2)
src/UniGetUI.Interface.Telemetry/TelemetryHandler.cs:86
- Consider adding a comment explaining that the check 'if (mask == 0x1)' serves as an overflow guard in the bit-shift operation within the settings magic value calculation.
if (mask == 0x1)
src/UniGetUI.Core.Settings/SettingsEngine_Dictionaries.cs:16
- [nitpick] Consider renaming the local variable 'setting' to 'resolvedKey' for improved clarity about its purpose.
string setting = ResolveKey(key);
|
estudia coño, tot el dia fent PRs |
Collaborator
Author
|
que pesao jajajajaj ves a estudiar BD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For easier coding, settings keys will be stored on
const stringsan enumeration